 /*	
  *				
  *					ISNW ---- It is a war.It is not warcraft!
  *
  *
  *					Author:					zhoukeli(haxixi_keli)
  *					Filename:				IReadFile.h
  *					CreateTime:				2008/12/15
  *					ModifyTime:				2008/12/15
  *
  */


#ifndef __I_READ_FILE_H__
#define __I_READ_FILE_H__

#include "isnwTypes.h"
#include "IReferenceCounted.h"

namespace ISNW
{
namespace io
{
	class IReadFile : public IReferenceCounted
	{
	public:
		virtual ~IReadFile(){}

	public:
		//! read amount of bytes from the file.s
		virtual s32 read(void* buffer,u32 size) = 0;

		//! set new file pointer position.
		virtual bool seek(s32 final_pos,bool relative = false) = 0;

		//! get the size of file.
		virtual s32 getsize() const = 0;

		//! get current file pointer position.
		virtual s32 getpos() const = 0;

		//! get current file name.
		virtual const c8* getfilename() const = 0;

	};

	//! create a read file object.
	extern IReadFile* createReadFile(const c8* filename);

} // end namespace io
} // end namespace ISNW
#endif